﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Lidgren.Network;
using Model.LiveControl;

namespace Network.Messages.LiveControl
{
    /// <summary>
    /// 
    /// </summary>
    public class MouseEventBase : NovaMessage
    {
        protected MouseEventBase(ushort type)
            : base(type)
        {
        }

        public CoustomMouseEventArgs MouseEventArgs;
        public int ScreenIndex;
        public virtual void SetSomethingBeforeWrite()
        {
            
        }
        public  override  void WritePayload(NetOutgoingMessage message)
        {
            SetSomethingBeforeWrite();
            base.WritePayload(message);
            MouseEventArgs.WritePayload(message);
            message.Write(ScreenIndex);
        }

        public override void ReadPayload(NetIncomingMessage message)
        {
            base.ReadPayload(message);
            MouseEventArgs = new CoustomMouseEventArgs();
            MouseEventArgs.ReadPayload(message);
            ScreenIndex = message.ReadInt32();
        }
    }
}
